<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.util.ArrayList, java.util.Iterator" %>
<%@ page import="util.Helper,pojo.ItemAttr,pojo.UserAttr" %>
<%
    Object validTime       = session.getAttribute("validTime");
    long nowTimeStamp      = Helper.getTimeStamp();
    if(validTime == null || Long.parseLong(validTime.toString()) < nowTimeStamp) {
        request.setAttribute("errorInfo", "非法登陆！");
        request.getRequestDispatcher("hint.jsp").forward(request, response);
    }
    Object objUserAttr   = session.getAttribute("userAttr");
    if(objUserAttr == null) {
        request.setAttribute("errorInfo", "非法登陆！");
        request.getRequestDispatcher("hint.jsp").forward(request, response);
    }
    UserAttr userAttr   = (UserAttr)objUserAttr;
    int userType        = userAttr.getUserType();
    if(userType != 1) {
        request.setAttribute("errorInfo", "非法登陆！");
        request.getRequestDispatcher("hint.jsp").forward(request, response);
    }
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>管理主页</title>
<link rel="stylesheet" href="./css/base.css" />
<style type="text/css">
    .manage_items{
        width: 600px;
        margin: 0px auto;
    }
    .manage_items ul li{
        float: left;
        width: 150px;
        list-style-type: none;
    }
</style>
</head>
<body>
    <div class="wrap">
        <div class="header">
            <p class="tool_bar">
                <a href="javascript:location.reload();">[刷新]</a>
                <a href="javascript:history.go(-1);">&lt;&lt;返回上一页</a>
                <a href="./index">返回主页&gt;&gt;</a>
                <a href="./logout">[退出]</a>
            </p>
            <h1>管理项</h1>
        </div>
        <div class="content">
            <div class="manage_items">
                <ul>
                	<li><a href="./admin/pollcount">查看投票统计</a></li>
                	<li><a href="./admin/userlist">用户列表</a></li>
                	<li><a href="./admin/itemlist">投票项目列表</a></li>
                	<li><a href="./admin/additem.jsp">添加投票项目</a></li>
                </ul>
            </div>
        </div>
        <jsp:include page="../comm/footer.jsp" flush="true"/>
    </div>
</body>
</html>